<html>
<head>
<title>Simple Ajax Example</title>
<script language="Javascript">
function xmlhttpPost(strURL,divId) {
    var xmlHttpReq = false;
    var self = this;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepage(self.xmlHttpReq.responseText,divId);
        }
    }
    self.xmlHttpReq.send(getquerystring());
}

function getquerystring() {
    var form     = document.forms['f1'];
    var word = form.word.value;
    var tim = form.tim.value;
    qstr = 'w=' + escape(word) + '&t='+ escape(tim);  // NOTE: no '?' before querystring
    return qstr;
}

function updatepage(str,div_id){
    document.getElementById(div_id).innerHTML = str;
}
</script>
</head>
<body>
<form name="f1">
  <p>word: <input name="word" type="text" placeholder='Symbol'>  <input name="tim" type="text" placeholder='1d, 5d, 1m, 3m, 6m, 1y, 2y, 5y, max'>  
  <input value="Go" type="button" onclick='JavaScript:xmlhttpPost("/cgi-bin/simple-ajaz-example.cgi","resulto")'></p>
  <div id="result"></div>
  <hr>
  table
  <table border=1><tr><td id="resulto">booboo</td></tr></table>
</form>
</body>
</html>
